import request from "@/utils/request.js";

/**
 * 订单确认获取订单详细信息
 * @param string cartId
 */
export function orderConfirm(data) {
	return request.post('/water/order/confirm', data);
}

/**
 * 订单创建
 * @param string key
 * @param object data
 * 
 */
export function orderCreate(key, data) {
	return request.post('/water/order/create/' + key, data);
}

export function orderList(status) {
	return request.get('/water/order/orderList/' + status);
}

/**
 * 订单列表
 * @param object data
 */
export function getOrderList(data) {
	return request.get('/water/order/list', data);
}

/**
 * 订单产品信息
 * @param string unique 
 */
export function orderProduct(data) {
	return request.post('/water/order/product', data);
}

/**
 * 订单统计数据
 */
export function orderData() {
	return request.get('/water/order/data')
}

/**
 * 订单取消
 * @param string id
 * 
 */
export function orderCancel(id) {
	return request.post('/water/order/cancel', {
		id: id
	}, {}, 1);
}

/**
 * 删除已完成订单
 * @param string uni
 * 
 */
export function orderDel(uni) {
	return request.post('/water/order/del', {
		id: uni
	}, {}, 1);
}

/**
 * 订单详情
 * @param string uni 
 */
export function getOrderDetail(uni) {
	return request.get('water/order/detail/' + uni);
}

/**
 * 再次下单
 * @param string uni
 * 
 */
export function orderAgain(uni) {
	return request.post('/water/order/again', {
		nui: uni
	});
}

